#include <iostream>
using namespace std;
class test
{
private:
	int aa;
	int bb;
public:
	//构造函数
	test(const int a=0,const int b=0):aa(a),bb(b){}
	//运算符重载+
	test operator+(const test&);
	//运算符重载*
	test operator*(const test&);
	//运算符重载=
	test& operator=(const test&);
	//运算符重载前++
	test& operator++();
	//运算符重载后++
	test operator++(int);
	//左移
	friend ostream& operator<<(ostream&,const test&);
	//右移
	friend istream& operator>>(istream&,test&);
	void show()
	{
		cout << "(a,b)=(" << aa << ","<< bb << ")" << endl;
	}
};
test test:: operator+(const test&a)
{
	aa=2;bb=2;
	test c;
	c.aa=aa+a.aa;
	c.bb=bb+a.bb;
	cout << "+:" <<  "(a,b)=(" << c.aa << ","<< c.bb << ")" << endl;
	return c;
}
test test::operator*(const test&a)
{
	aa=2;bb=2;
	test c;
	c.aa=aa*a.aa;
	c.bb=bb*a.bb;
	cout << "*:" <<  "(a,b)=(" << c.aa << ","<< c.bb << ")" << endl;
	return c;
}
test& test::operator=(const test&a)
{
	aa=2;bb=2;
	aa=a.aa;
	bb=a.bb;
	cout << "=:" <<  "(a,b)=(" << aa << ","<< bb << ")" << endl;
	return *this;
}
test& test::operator++()
{
	aa=2;bb=2;
	aa++;
	bb++;
	cout << "前++" <<  "(a,b)=(" << aa << ","<< bb << ")" << endl;
	return *this;
}
test test::operator++(int a)
{
	aa=2;bb=2;
	test temp=*this;
	aa++;
	bb++;
	cout << "后++" <<  "(a,b)=(" << temp.aa << ","<< temp.bb << ")" << endl;
	return temp;

}
ostream& operator<<(ostream&out,const test&a)
{
	out << "out" <<  "(a,b)=(" << a.aa << ","<< a.bb << ")" << endl;
	return cout;
}
istream& operator>>(istream&in,test&a)
{
	in >> a.aa >> a.bb;
	return cin;
}
int main()
{
	test a;
	test b(2,3);
	//
	test c=a+b;
	test d=a.operator*(b);
	a=b;
	++a;
	a++;
	cout << "a:" << a << "b:" << b;
	cin >> a;
	return 0;
}

